Optimal. Leaf size=76 \[ \frac {b \tanh ^{-1}(\sin (e+f x))}{d f}-\frac {2 (b c-a d) \tanh ^{-1}\left (\frac {\sqrt {c-d} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c+d}}\right )}{\sqrt {c-d} d \sqrt {c+d} f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 76, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {4083, 3855,
3916, 2738, 214} \begin {gather*} \frac {b \tanh ^{-1}(\sin (e+f x))}{d f}-\frac {2 (b c-a d) \tanh ^{-1}\left (\frac {\sqrt {c-d} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c+d}}\right )}{d f \sqrt {c-d} \sqrt {c+d}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 214
Rule 2738
Rule 3855
Rule 3916
Rule 4083
Rubi steps
\begin {align*} \int \frac {\sec (e+f x) (a+b \sec (e+f x))}{c+d \sec (e+f x)} \, dx &=\frac {b \int \sec (e+f x) \, dx}{d}+\frac {(-b c+a d) \int \frac {\sec (e+f x)}{c+d \sec (e+f x)} \, dx}{d}\\ &=\frac {b \tanh ^{-1}(\sin (e+f x))}{d f}-\frac {(b c-a d) \int \frac {1}{1+\frac {c \cos (e+f x)}{d}} \, dx}{d^2}\\ &=\frac {b \tanh ^{-1}(\sin (e+f x))}{d f}-\frac {(2 (b c-a d)) \text {Subst}\left (\int \frac {1}{1+\frac {c}{d}+\left (1-\frac {c}{d}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (e+f x)\right )\right )}{d^2 f}\\ &=\frac {b \tanh ^{-1}(\sin (e+f x))}{d f}-\frac {2 (b c-a d) \tanh ^{-1}\left (\frac {\sqrt {c-d} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c+d}}\right )}{\sqrt {c-d} d \sqrt {c+d} f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.19, size = 112, normalized size = 1.47 \begin {gather*} \frac {\frac {2 (b c-a d) \tanh ^{-1}\left (\frac {(-c+d) \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{\sqrt {c^2-d^2}}+b \left (-\log \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )+\log \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )\right )}{d f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.27, size = 92, normalized size = 1.21
method | result | size |
derivativedivides | \(\frac {-\frac {2 \left (-a d +b c \right ) \arctanh \left (\frac {\left (c -d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (c +d \right ) \left (c -d \right )}}\right )}{d \sqrt {\left (c +d \right ) \left (c -d \right )}}+\frac {b \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{d}-\frac {b \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{d}}{f}\) | \(92\) |
default | \(\frac {-\frac {2 \left (-a d +b c \right ) \arctanh \left (\frac {\left (c -d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (c +d \right ) \left (c -d \right )}}\right )}{d \sqrt {\left (c +d \right ) \left (c -d \right )}}+\frac {b \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{d}-\frac {b \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{d}}{f}\) | \(92\) |
risch | \(\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c^{2}-i d^{2}+\sqrt {c^{2}-d^{2}}\, d}{\sqrt {c^{2}-d^{2}}\, c}\right ) a}{\sqrt {c^{2}-d^{2}}\, f}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c^{2}-i d^{2}+\sqrt {c^{2}-d^{2}}\, d}{\sqrt {c^{2}-d^{2}}\, c}\right ) b c}{\sqrt {c^{2}-d^{2}}\, f d}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {-i c^{2}+i d^{2}+\sqrt {c^{2}-d^{2}}\, d}{c \sqrt {c^{2}-d^{2}}}\right ) a}{\sqrt {c^{2}-d^{2}}\, f}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {-i c^{2}+i d^{2}+\sqrt {c^{2}-d^{2}}\, d}{c \sqrt {c^{2}-d^{2}}}\right ) b c}{\sqrt {c^{2}-d^{2}}\, f d}+\frac {b \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}{d f}-\frac {b \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}{d f}\) | \(327\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 5.43, size = 328, normalized size = 4.32 \begin {gather*} \left [-\frac {{\left (b c - a d\right )} \sqrt {c^{2} - d^{2}} \log \left (\frac {2 \, c d \cos \left (f x + e\right ) - {\left (c^{2} - 2 \, d^{2}\right )} \cos \left (f x + e\right )^{2} + 2 \, \sqrt {c^{2} - d^{2}} {\left (d \cos \left (f x + e\right ) + c\right )} \sin \left (f x + e\right ) + 2 \, c^{2} - d^{2}}{c^{2} \cos \left (f x + e\right )^{2} + 2 \, c d \cos \left (f x + e\right ) + d^{2}}\right ) - {\left (b c^{2} - b d^{2}\right )} \log \left (\sin \left (f x + e\right ) + 1\right ) + {\left (b c^{2} - b d^{2}\right )} \log \left (-\sin \left (f x + e\right ) + 1\right )}{2 \, {\left (c^{2} d - d^{3}\right )} f}, -\frac {2 \, {\left (b c - a d\right )} \sqrt {-c^{2} + d^{2}} \arctan \left (-\frac {\sqrt {-c^{2} + d^{2}} {\left (d \cos \left (f x + e\right ) + c\right )}}{{\left (c^{2} - d^{2}\right )} \sin \left (f x + e\right )}\right ) - {\left (b c^{2} - b d^{2}\right )} \log \left (\sin \left (f x + e\right ) + 1\right ) + {\left (b c^{2} - b d^{2}\right )} \log \left (-\sin \left (f x + e\right ) + 1\right )}{2 \, {\left (c^{2} d - d^{3}\right )} f}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (a + b \sec {\left (e + f x \right )}\right ) \sec {\left (e + f x \right )}}{c + d \sec {\left (e + f x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.54, size = 127, normalized size = 1.67 \begin {gather*} \frac {\frac {b \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1 \right |}\right )}{d} - \frac {b \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1 \right |}\right )}{d} + \frac {2 \, {\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, c - 2 \, d\right ) + \arctan \left (\frac {c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{\sqrt {-c^{2} + d^{2}}}\right )\right )} {\left (b c - a d\right )}}{\sqrt {-c^{2} + d^{2}} d}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.73, size = 573, normalized size = 7.54 \begin {gather*} \frac {a\,c^2\,\ln \left (\frac {c\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )-d\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )+\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {c^2-d^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )}{f\,{\left (c^2-d^2\right )}^{3/2}}-\frac {a\,d^2\,\ln \left (\frac {c\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )-d\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )+\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {c^2-d^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )}{f\,{\left (c^2-d^2\right )}^{3/2}}-\frac {2\,b\,d\,\mathrm {atanh}\left (\frac {\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )}{f\,\left (c^2-d^2\right )}-\frac {a\,\ln \left (\frac {c\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )+d\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )-\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {c^2-d^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )\,\sqrt {\left (c+d\right )\,\left (c-d\right )}}{f\,\left (c^2-d^2\right )}+\frac {b\,c\,d\,\ln \left (\frac {c\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )-d\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )+\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {c^2-d^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )}{f\,{\left (c^2-d^2\right )}^{3/2}}+\frac {2\,b\,c^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )}{d\,f\,\left (c^2-d^2\right )}-\frac {b\,c^3\,\ln \left (\frac {c\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )-d\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )+\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {c^2-d^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )}{d\,f\,{\left (c^2-d^2\right )}^{3/2}}+\frac {b\,c\,\ln \left (\frac {c\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )+d\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )-\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {c^2-d^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )\,\sqrt {\left (c+d\right )\,\left (c-d\right )}}{d\,f\,\left (c^2-d^2\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________